I don't know anything about PHP, but I'm wondering how simple it is to make a page on my site that: - uses the threads header - has the little menu bar (possibly alert for PMs) - can contain JavaScript code in the middle for a chatroom
Thus the page has the same look, feel and options as the rest of the site...and the user appears in "Who's Online" as "in the Chatroom" or something like that.
How easy might this be for a novice? Or is it just a page with some sort of "include $header" sort of instruction then the JavaScript for the chatroom...or can you NOT use JavaScript stuff in a "threads" PHP Page?
JustDave can answer you better, but it sounds like you could use a copy of the integrated index page and replace some of the calls with the chat stuff you wanna add.
It's actualy not that hard at all. On my main site http://www.chattersonline.com ever single page uses the threads for header/footer and auth. I'll put together an example and post it later today. []/forum/images/icons/smile.gif[/]
Give me an email address and I'll send the page to you. You should be able to replace the "quickchat" java code I have with your code and everything will work fine. Make sure you put the page in your UBBThreads installation directory so that it reads everything o.k. []/forum/images/icons/smile.gif[/]
Note: My page looks a little different from the norm because I'm running Allen's compact headers hack. I can edit the file I send you to work for your site if you don't have that installed.
Do you know, if you edit the online.php in the language files can you make "who's online" show "in the chatroom" or something similar? Couldn't tell on your site...maybe noone was in the chatroom when I was there.
Most everyone uses mIRC to access our chat room, but I have modified the online.php file in /languages to say "In the Chat Room". The specific line of code is:
$ubbt_lang['chat'] = "In the chat room";
I've emailed you the file and I removed the two lines for the compact headers hack. You'll just need to replace the section that starts with:
Thanks! That's exactly what I was looking for. Found a few more uses for the basic page as well. And if you add to the online.php for each new page... it really helps integrate the site together!
question here as my chat seems to work with a html file like I had before but it loads fine with this new chat.php but never connects?
<? /* # UBBThreads, Version 5 # Official Release Date for UBBThreads Version5: December 12, 2000.
# First version of UBBThreads created July 30, 1996 (by Rick Baker). # This entire program is copyright Infopop Corporation, 2001. # For more info on the UBBThreads and other Infopop # Products/Services, visit: http://www.infopop.com
# Program Author: Rick Baker.
# You may not distribute this program in any manner, modified or otherwise, # without the express, written written consent from Infopop Corporation.
# Note: if you modify ANY code within UBBThreads, we at Infopop Corporation # cannot offer you support-- thus modify at your own peril []/forum/images/icons/smile.gif[/] # --------------------------------------------------------------------------- */
Okay I started from scratch and got it working. I have another question?
How can I get Jpilot to automaticallly recognize the users board name so I can set my chat back to start automatically instead of going to a config window where they have to input their name?
1) If a user has selected a specific CSS in their profile, will it be used to control the properties of the html tags in the basic page (I'm hoping yes)?
2) If I wanted to use parts of your IIP hack could I insert them anywhere after the main.inc.php file / user info is aquired? I really like your IIP work, but I don't want to change the layout of my web site, nor do I need every "modual" that you wrote for IIP. So I'd like to pick and choose what I want to display on my site. I know, picky picky...
1. Some css properties will carry over to properties set on specific tags. Custom property classes can only be accessed by placing the class="somestylename" into the tags themselves. Properties set for the BODY tag will affect the entire body of the page. The same will go for other tags such as <table>, <p>, <b> and all others.
2. It may be possible with a lot of work. (depending on the pal box of course)
I understand how CSS works, just wasn't sure if the user's preferences were being querried in the basic page script that you posted (PHP does so much "in the background" that simple instructions are sometimes difficult to decipher for a newbie like myself).
The staus box is the only one I'd like to implement now, since I think it would be cool for users to hit my index page and be able to see if they had any new private messages.
Thanks for the script and for taking the time to answer my questions!
I've been testing the script that you gave me, and it does work. The problem is when I try to use any additional php scripting between
<!-- BASIC PAGE START -->
and
<!-- BASIC PAGE END -->
I figured out what I was doing wrong (no need to declare $html more than once, no need to require main.inc.php more than once. This is what I have so far:
The only problem now is that there doesn't seem to be any access to cookie information cause when I go to the test index I'm not automaticly logged in.
I aslo haven't been able to get it to work in a .shtml file as a server side include (not sure if it's possible, and not a setback).
Everything between the html comments is for html only. There is no php parsing done. If your going to add php code you will need to add it before the first ?> closing.
posted by JustDave: Everything between the html comments is for html only. There is no php parsing done. If your going to add php code you will need to add it before the first ?> closing.
I did it just by going back into php by using <? Later I can change the script so that I'm not going in and out of php, but for now it helps to keeps things separate while I squash all the bugs.
Either you think I'm a total newbie at this sort of thing, or I'm not phrasing my responses to you very well...
Going in and out of php isn't a bad thing, in fact, the regular html will be displayed faster as php does not have to parse it. Also, the same thing holds true for echo statements with single quotes, example: echo 'your html here'; but there will be no variable value replacements in single quoted strings so if your only wanting to send html to the screen with no php variables present you should use the single quotes in an echo statement.
Not exactly. In the area where you put the "insert html here" I needed to plug in some more php scripting, specificly the news posting script that comes with Threads that I hacked. Unfortunately the news posting script requires main.inc.php, and requiring it twice in the same script (after cutting and pasting it into the basic page that you posted) was causing problems.
So, I just used the <? tag to go back into "php mode" in the area that you designated for html. No big deal, cause it's just a test page that I'm hacking on. The end result was the test page that I linked two a few posts ago. I can always go back and clean up the tags in the final script.
Later I'll turn the code that you gave me into two php includes and call them on every page on my web site that needs them (like a server side include). I just have to remember to remove any duplicate require statements.
I was looking at the IIP scripting today and noticed how you are authenticating users. Is that all that is needed to get the info for the status and login pal that you wrote?
posted by JustDave: Authentication with an empty string should be all that is needed unless your after more than the basic information of a user.
This code:
$userob = new user; $user = $userob -> authenticate("");
Will return Username, Password, SessionID, StyleSheet, Status, # New Privates and Front Page prefs.
If you need other information you can add as needed to the authentication call.
Thanks! The problem is that I'm not automaticly logged in when I hit the page. I can tell I'm not logged in cause I don't have "Admin" in the menu. How can I get a registered user to automaticly authenticate to the index page?
require ("{$PathToThreads}main.inc.php"); // Get the user info $Username = $w3t_myname; $Password = $w3t_mypass; $userob = new user; $user = $userob -> authenticate("");
posted by Dalantech: Thanks! The problem is that I'm not automaticly logged in when I hit the page. I can tell I'm not logged in cause I don't have "Admin" in the menu. How can I get a registered user to automaticly authenticate to the index page?
Are your cookies set site wide? The cookie path in your configure file for .threads should = "/"
I managed to log in one time and get the status window (using the loginpal.php file) but after logging out I can't log back in. I've already se the cookies path to /
posted by Dslam: blah my bad your want to be logged in automatic humm you got me if your cookiepath is set to site wide it should work
Yup, that's what I'm trying to do and it's almost driving me to therapy
I even tried using the script that ubbthreads.php uses and it didn't work. Cookies are set site wide, but I'm not the only one on the server so I may have to set it to my web root directory. More hackin'...
ubbt_registerednav.tmpl is the menu template that is used to generate the menu for registered users, so if you want a "registered users only link" just add it to that template.
I went back to the scripts I was using to generate the index page and authentication worked!? No idea why I was having problems before, maybe the server was caching some of the variables. Oh well, it works
Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.
Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.